package com.system.provider;

import com.am.ui.grid.AbstractBaseGridProvider;
import com.system.uitls.SearchFilter;
import java.util.Map;

public class ReferralProvider extends AbstractBaseGridProvider
{
  public String generateSql(Map<String, Object> map)
  {
    StringBuffer sf = new StringBuffer("SELECT t1.create_time,t1.hospital,t1.subject,t2.user_name,t2.person_name FROM sys_referral t1,sys_patient_record t2 WHERE t1.record_id = t2.id AND t2.person_id=:personId AND t2.status='7'");

    sf.append(SearchFilter.getSearchSql(map, null));

    sf.append(" ORDER BY create_time DESC");
    setParamMap(map);
    return sf.toString();
  }
}